package com.jeecg.service;

import java.util.List;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jeecg.dao.UserDao;
import com.jeecg.entity.User;

@Service
public class UserService {

	@Autowired
	private UserDao userDao;
	
	public void addUser(User user) {
		user.setId(UUID.randomUUID().toString());
		//userDao.saveByHiber(user);
		userDao.addUser(user);
	}
	
	public void updateUser(User user) {
		userDao.updateByHiber(user);
	}
	
	public void delteUser(User user){
		userDao.deleteByHiber(user);
	}
	
	public List<User> findAll() {
		return userDao.findAll();
	}
}
